/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CommonParam } from '../models/CommonParam';
import type { Result } from '../models/Result';
import type { RoomType_ } from '../models/RoomType_';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class RoomTypeControllerService {

    /**
     * addType
     * @param roomType roomType
     * @returns Result OK
     * @returns any Created
     * @throws ApiError
     */
    public static addTypeUsingPost(
roomType: RoomType_,
): CancelablePromise<Result | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/room-type/add',
            body: roomType,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * listPage
     * @param commonParam commonParam
     * @returns Result OK
     * @returns any Created
     * @throws ApiError
     */
    public static listPageUsingPost2(
commonParam: CommonParam,
): CancelablePromise<Result | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/room-type/page',
            body: commonParam,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * update
     * @param roomType roomType
     * @returns Result OK
     * @returns any Created
     * @throws ApiError
     */
    public static updateUsingPost(
roomType: RoomType_,
): CancelablePromise<Result | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/room-type/update',
            body: roomType,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * isUse
     * @param id id
     * @returns Result OK
     * @throws ApiError
     */
    public static isUseUsingGet(
id?: string,
): CancelablePromise<Result> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/room-type/used',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * deleteById
     * @param id id
     * @returns Result OK
     * @throws ApiError
     */
    public static deleteByIdUsingGet(
id?: string,
): CancelablePromise<Result> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/room-type/{id}',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

}
